package com.xinsilu.hospital.controller;


import com.xinsilu.common.Result;
import com.xinsilu.hospital.entity.Project;
import com.xinsilu.hospital.service.IProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ym
 * @since 2021-12-15
 */
@RestController
@RequestMapping("/api/hospital/project")
public class ProjectController {
    @Autowired
    private IProjectService iProjectService;

    @RequestMapping("/tianjiaxm")
    public Object tianjiaxm(Project project) {
        boolean save = iProjectService.tianjiaxm(project);
        if(save){
            return Result.ok("成功");
        }else{
            return Result.ok("失败");
        }
    }
    @RequestMapping("/projectList")
    public Object projectList(Project project) {
        List<Project> list = iProjectService.ProjectList(project);
        return Result.ok(list);
    }


}
